test: add UI E2E tests for Argo CD Resource Tree and Pod logs#1190
test: add UI E2E tests for Argo CD Resource Tree and Pod logs#1190trdoyle81 wants to merge 4 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
5d99606 to
9ac9377
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughUpdates UI E2E authentication, execution, setup, fixtures, and application/resource-tree test flows. ChangesUI E2E Test Suite Enhancements
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/ui-e2e/README.md`:
- Line 71: The unescaped pipe character in the inline flag `--env=<ci|pipeline>`
on line 71 of the table is being interpreted as a Markdown table column
separator, causing the table structure to break (MD056 error). Escape the pipe
character by adding a backslash before it in the flag value so that Markdown
treats it as literal text rather than a column delimiter, maintaining the
intended 2-column table layout.
In `@test/ui-e2e/run-ui-tests.sh`:
- Around line 70-82: In the CI/pipeline automation block where ENV is "ci" or
"pipeline", the npx playwright test command on line 81 passes TEST_ARGS verbatim
without enforcing headless mode. If TEST_ARGS contains a --headed flag, it will
override the intended automation behavior and can fail in headless-only
environments. Either filter out any --headed flags from TEST_ARGS before passing
them to the playwright test command, or explicitly add a --headed=false flag to
the npx playwright test invocation within the CI/pipeline conditional block to
ensure headless execution is enforced regardless of user-provided arguments.
- Around line 15-24: The .env file is being sourced before the script changes to
its own directory, causing the check for .env and the source command to look in
the caller's current working directory instead of the test/ui-e2e directory.
Move the cd "$(dirname "$0")" || exit 1 command to execute before the if [ -f
.env ] block so that the .env file is correctly loaded from the script's own
directory, not from wherever the script was invoked.
In `@test/ui-e2e/src/pages/ApplicationDetailsPage.ts`:
- Line 26: The assertion on the "Healthy" text is currently scoped to the entire
page via this.page.getByText, which can match unrelated UI elements and cause
false positives. Instead of using this.page.getByText('Healthy', { exact: true
}).first(), first locate the resource tree container element, then apply the
getByText selector to that specific container element rather than the whole page
to ensure you're only checking the health status within the correct UI region.
In `@test/ui-e2e/src/pages/ApplicationsPage.ts`:
- Around line 107-119: Scope the selectors in the sync panel operations to
prevent matching unintended elements. Instead of using page-wide selectors
(`this.page.getByRole()` and `this.page.getByText()`), scope the allLink
selector at line 107, the expectedResource text selector at line 115, and the
synchronize button selector at line 118 to the sync panel context that was
opened earlier with `appContainer.getByText('Sync')`. Store the sync panel
locator and use it to scope all three subsequent selectors to that specific
panel rather than querying the entire page.
- Around line 140-143: The appLink selector in the openApplication method uses
non-exact matching on both the filter and getByRole calls, which can incorrectly
match similarly-named applications (e.g., petclinic vs petclinic-dev). Add
exact: true to both the hasText filter and the getByRole link selector to ensure
precise matching. This pattern is already demonstrated elsewhere in the file at
line 13 for the Create button selector.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 18061886-be38-48c8-bd67-bf81bbece892
📒 Files selected for processing (8)
test/ui-e2e/.auth/setup.tstest/ui-e2e/README.mdtest/ui-e2e/run-ui-tests.shtest/ui-e2e/src/pages/ApplicationDetailsPage.tstest/ui-e2e/src/pages/ApplicationsPage.tstest/ui-e2e/src/pages/LoginPage.tstest/ui-e2e/tests/admin-login.spec.tstest/ui-e2e/tests/resource-tree.spec.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
argoproj-labs/argocd-operator(manual)
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/ui-e2e/.auth/setup.ts`:
- Around line 62-72: The Welcome Tour handling in setup should only ignore the
expected “not visible within timeout” case, not every exception. Update the
try/catch around the skipTourButton wait/click logic so that errors from
page.getByRole, skipTourButton.waitFor, and skipTourButton.click are checked for
timeout/not-present behavior and only those are logged and ignored; rethrow any
other error to surface real UI regressions.
- Around line 31-41: Escape the env-driven IDP value before using it in the
locator regex, since `setup.ts` builds `new RegExp(idpName, 'i')` directly in
the IDP selection flow. Update the `idpName` handling near the `idpScreenText`
check and `page.getByRole('link', { name: ... })` so special regex characters in
`process.env.IDP` are treated as literal text, preventing match failures or
regex errors during login setup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 18a3c0c4-5379-4507-9500-71c94bceedeb
📒 Files selected for processing (5)
test/ui-e2e/.auth/setup.tstest/ui-e2e/global.setup.tstest/ui-e2e/playwright.config.tstest/ui-e2e/src/fixtures.tstest/ui-e2e/src/pages/ApplicationsPage.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
argoproj-labs/argocd-operator(manual)
🚧 Files skipped from review as they are similar to previous changes (1)
- test/ui-e2e/src/pages/ApplicationsPage.ts
1f0f3b6 to
d7f7794
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/ui-e2e/global.setup.ts`:
- Around line 15-18: The catch block in global.setup.ts is masking real failures
from the cleanup command and incorrectly logging success. Update the error
handling around the execSync cleanup path so the catch in the setup flow does
not discard the thrown error; instead, surface the underlying failure details
and let the test setup fail or abort appropriately. Use the existing setup logic
around the execSync call and the log messages “Cluster sanitized” / “Cluster is
clean” to locate the block and replace the silent success path with explicit
error reporting.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 1fe4afa0-faf2-4126-acf6-801cc318f8de
📒 Files selected for processing (2)
test/ui-e2e/.auth/setup.tstest/ui-e2e/global.setup.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
argoproj-labs/argocd-operator(manual)
🚧 Files skipped from review as they are similar to previous changes (1)
- test/ui-e2e/.auth/setup.ts
d7f7794 to
9d462d6
Compare
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
9d462d6 to
17319d0
Compare
|
/retest |
What type of PR is this?
/kind enhancement
What does this PR do / why we need it:
This adds the UI E2E test suite for the Argo CD Application Details page. It verifies that the Resource Tree renders correctly and that Pod log streams are accessible. It also includes cross-version stability updates to handle OpenShift popups and Argo CD loading banners.
Have you updated the necessary documentation?
Which issue(s) this PR fixes:
Fixes GITOPS-9685
Test acceptance criteria:
[ ] Unit Test
[x] E2E Test
How to test changes / Special notes to the reviewer:
Run the new test locally against any provisioned cluster:
./run-ui-tests.sh tests/resource-tree.spec.ts --headed --project=chromium